<html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms"
	xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
	xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xi="http://www.w3.org/2001/XInclude"
	xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
	<head>
		<title>Numishare: Edit Index</title>
		<link type="text/css" href="http://localhost:8080/cocoon/numishare/xforms.css"
			rel="stylesheet"/>
		<xforms:model>
			<xforms:instance id="site-info">
				<site_info xmlns="">
					<pages>
						<index/>
					</pages>
				</site_info>
			</xforms:instance>

			<xforms:instance id="status">
				<status/>
			</xforms:instance>

			<xforms:send ev:event="xforms-model-construct-done" submission="load-submission"/>

			<xforms:bind nodeset="instance('site-info')">
				<xforms:bind nodeset="pages">
					<xforms:bind nodeset="index">
						<xforms:bind constring="string-length(.) &gt; 0"/>
					</xforms:bind>
				</xforms:bind>
			</xforms:bind>

			<!-- Load File -->
			<xforms:submission id="load-submission" serialization="none" method="get"
				action="/exist/rest/db/numishare/site_info.xml" xxforms:username="admin"
				xxforms:password="admin" replace="instance" instance="site-info"/>

			<!-- Save File -->
			<xforms:submission id="save-submission" ref="instance('site-info')"
				xxforms:username="admin" xxforms:password="admin"
				action="/exist/rest/db/numishare/site_info.xml" method="put" replace="none">
				<xforms:setvalue ev:event="xforms-submit-done" ref="instance('status')">Index
					Saved</xforms:setvalue>
				<xforms:message ev:event="xforms-submit-error" level="modal">Save
					Error!</xforms:message>
			</xforms:submission>
		</xforms:model>

	</head>
	<body>
		<div class="form">
			<xforms:group ref="instance('status')/text()">
				<div class="success">
					<xforms:output ref="instance('status')"/>
				</div>
			</xforms:group>
			<div class="submission">
				<xforms:submit submission="save-submission" appearance="minimal">
					<xforms:label class="file_control"><img src="/apps/numishare/images/save.gif"
							alt="Save"/> Save</xforms:label>
				</xforms:submit>
			</div>
			<xforms:group ref="instance('site-info')//index">
				<div class="section">
					<div>
						<h3>Index Content</h3>
						<xforms:textarea ref="." mediatype="text/html">
							<xforms:alert>Content Required.</xforms:alert>
						</xforms:textarea>
					</div>
				</div>
			</xforms:group>
		</div>
	</body>
</html>
